package com.easy.mapper;

import com.easy.bean.Inventory;
import com.easy.util.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface InventoryDao {
    int add(@Param("param") Inventory inventory);
    int del(@Param("id") Integer id);
    int edit(@Param("param") Inventory inventory);
    Inventory one(@Param("id") Integer id);
    List<Inventory> all(
            @Param("itemType") String itemType,
            @Param("location") String location
    );
    int pageCount(@Param("param") Inventory inventory);
    List<Inventory> page(@Param("page") Page page, @Param("param") Inventory inventory);
    
    /**
     * 根据物品ID和类型查找库存记录
     * @param itemId 物品ID
     * @param itemType 物品类型
     * @return 库存记录
     */
    Inventory findByItem(@Param("itemId") Integer itemId, @Param("itemType") String itemType);
}